﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Asp/admin.master" AutoEventWireup="true" CodeFile="edit_model.aspx.cs" Inherits="Admin_Asp_edit_model" EnableSessionState="True" %>
<%@ Register Src="~/Admin/Asp/UserControls/ModelEditHandler.ascx" TagName="ModelEditHandler" TagPrefix="uc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script type="text/javascript" src="../Js/edit_models.js" ></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="main_placeholder" Runat="Server">

    <asp:MultiView ID="x_index_multiview" ActiveViewIndex="0" runat="server">
        <!--% View for a list of all the models where you choose which one to edit  %-->
        <asp:View ID="x_modellist" runat="server" >
            <h2>Edit models</h2> 
            
            <p class="notice">
                Here you can edit existing models. To edit a model click the Edit model button. When you are editing a model you can change its textures, the availible shaders or remove the model completly.
            </p>
               
            <ul id="model_item_list">
                <%
                    for (int i = 0; i < m_items.Count; i++)
                    {
                        ModelItem f_item = m_items[i];
                    %>
                        <li class="model_item">
                            <p>
                                <strong>Name:</strong> <% Response.Write(f_item.m_name);  %> <br />
                                <strong>Path:</strong> <% Response.Write(f_item.m_path); %> <br />
                            </p>
                            <div class="model_item_thumbnail">
                                <div class="model_item_texture_left">
                                
                                <p>
                                    <strong>Thumbnail:</strong> <% Response.Write(f_item.m_thumbnailPath); %>
                                </p>
                                </div>
                                <div class="model_item_texture_right">
                                    <img alt="" src="<% Response.Write( Paths.admin_to_serverRoot + f_item.m_thumbnailPath ); %>" />
                                </div>
                                <div style="clear:both"></div>
                            </div>                            
                            <p>
                                <strong>Shaders:</strong>
                                    <% 
                                        for (int j = 0; j < f_item.m_shaders.Count; j++)
                                        {
                                            Response.Write( f_item.m_shaders[j] + " " );
                                        }
                                    %> <br />
                                <strong>Textures:</strong>   
                            </p>
                            <ul>
                                <% 
                                    for (int j = 0; j < f_item.m_textures.Count; j++)
                                    {
                                        %>
                                        <li class="model_item_texture">                                            
                                            <div class="model_item_texture_left">
                                                <p>
                                                    <strong>Type:</strong> <% Response.Write(f_item.m_textures[j].GetType() ); %> <br />
                                                    <strong>Path:</strong> <% Response.Write( f_item.m_textures[j].m_path ); %> 
                                                </p>
                                            </div>
                                            <div class="model_item_texture_right">
                                                <img alt="<% Response.Write(f_item.m_textures[j].GetType()); %>" src="<% Response.Write( Paths.admin_to_serverRoot + f_item.m_textures[j].m_path ); %>" />
                                            </div>
                                            
                                            <div style="clear:both"></div>
                                        </li>
                                        <%
                                    }
                                %> 
                                          
                            
                            </ul> 

                            <p>
                                <a href="<% Response.Write( Paths.admin_edit_model + "?" + m_itemIDRequestName + "=" + i.ToString() ); %>" >Edit Model</a>
                            </p>
                    
                        </li>
                        <%
                    }            
                %>
            </ul>

        </asp:View>
        <!--  -->
        <asp:View ID="x_editSelected" runat="server">
            <h2>Edit specific model</h2>
            <p class="notice">This is where you edit the model. You can not edit the modelpath.</p>

            <asp:PlaceHolder ID="x_modelhandler" runat="server">
                
            </asp:PlaceHolder>            
        </asp:View>

    </asp:MultiView>


    

</asp:Content>

